function featuresCtrl($scope, $route, $rootScope, $timeout, commonService, $location) {

    _log('### features ###');
    
    $scope.newFeature = [];
    $scope.newHeader = {};
    $scope.newHeaderSrc = {};
    
    $scope.renderHeader = function(txt)
    {
        return txt.length > 50 ? txt.substr(0 ,50)+ '...' : txt;
    };
    $scope.renderDetail = function(txt)
    {
        return txt.length > 190 ? txt.substr(0 ,190)+ '...' : txt;
    };

    var url = 'content_ws.php';
    var params = {
	wsname : 'getcontentbycategoryid',
	catid : 5, // TODO
	token : _pageData.tokenKey
    };
    
    $.getJSON(_COMMON.context + url, params).done(function(result) {
	$scope.$apply(function() {
	    var datas = result.contents;
	    for (i in datas) {
		if(datas[i]['alias'] == 'new_feature'){
		    	if(i > 0 ){
            		    $scope.newFeature.push(datas[i]);
        		}else{
        		    $scope.newHeader = datas[i];
        		}
		}
	    }
	    
	    $timeout(function() {
		
		 var el = $('[id^=h-img]' );
		 $.each( el, function( key, value ) {
		     var k = value.id.replace('h-','');
		     var s = $('#'+value.id+' img').attr('src');
		     s? s : s='app/images/img-not-found.jpg';
		     $('#'+k).attr('src' , s);
		     $('#'+k+'-link').attr('href' , s);
		     if(k=='img-x'){
			 $scope.newHeaderSrc =s;
		     }
//		     _log(k+'-link');
		 });
		
		 _COMMON.loading(null , 0);
		 
	    }, 1000);
	    
	    
	});
    });
    
    
    $scope.viewDetail = function (id) {
        $location.path('/admin/newsDetail');
        $location.search('id', id);
    };
    
}
